package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016092100559592";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCqcFW2S4aAxF90xJSM8dW6R292yssj0iQyK4I31/N6rLWu3lL14l6vb53Ve6J2MEJPTG1UeKz+InACIYj4xEPooIsXpB1fwOjYrqE3QL/XdlIqkyMOQJvBAvqzTxpxJnvzkEZJaIpKcj41SQz/B7tedFm24YvDiIN4m4Zl6OfDSuCWwQ4Z0F/4Locuzgo+yIfhzWx9NMZa18Rxtji5TnLq33LpCJIKUAcvqqxYig5sVSp5KceTh9KEmXGeovgH9Hvx4LJQaYXyzdXJBuODCdhdDJFakiq5WQKtgs8fYtgU9dHT4w+tYrJ70SeAGrlVB7+vW9VACzY3rKjxpVR/zV7rAgMBAAECggEALnk/BdwGKupg1OgdUWlHy+lanVuilHviXsO6WBvMSjD5wVrh6CX3h4K52NJDdFKoYhMG5LebBBjDzfDy9lId6jqMcr/POqLRWvQTBYvkQ44BzZYdQu+fCLwVO/tfzGaf+cPnRnD49F++Uq0+m/OxxYmYROOvRnvczXAq73LYb0lyw+OBOoFpxeH1DFUWr/fPm1/2D1Tjk0bAr4IqxlciFiC/64xghYStdyBGXkEhJsGoDXw/VZtC5b95kbSF30jVFhJtX3hkHOgl3/OAdE1uhdGPgY6brgG2hRFYdlyb8wnR+LKTxW4HZrI3CLEtXXYiTnry04sAkgBmM1IcAAVwQQKBgQDrftA/LAPK6Strs1iitDmao2abLTTshMtCROt7GExHxy9lxN7nBT4KhX97sArVwn/7OOF+nkeZC+5ltnd+ABtOeXnGL7rlq8q3INoKUMEG0Pqu+AH46UtnxS+sEY/UIy74K0Qd+MKX3BApEve+UxN4Ww02Q6u3dWCws7kwgUOa2wKBgQC5R2mAIzI0ZiUTFVCD+hdI4evTTLDf776TyrTC1hJ3DCcnhmAaylFZhtEPYuj0EttrQmX0wPQehk0FwjSYCAnv217vxJJEZwpqJuFnT14CPI+lFW6gSJkhNsYtzW3md5xRL02YoNvb3f17E0/DA4IxM6Bm6HZ40FJxJ5k7tzuhMQKBgAoqXjjr4HoI2Kv8gO39E6N+PDakm+09yjxhFz0oDlrm2T/uYKTeUBBKNPeU4NLbY4Tnrqw1juenYTIYz02sGYGosr4AX3P8l3KSQ3dAhySRLtEQuZ0SDQQ8udMWqvvATQ2/aGBW1aeSg0wSmoknsuZ2H7rg7u+rbHIUQAE9AzsTAoGAaPeNTLwj8E3CSVp1ACBK2s6rtU0ok+YWeVKJMCzpzypCcIEPp33hsq/Pd0EZK1YXm1/FtXEvnK+HqXCKLWu4fXwx//LEzx31Z4hZgRcU8n1vAB7xSrt2jbujcUWGMuCm3dPHyWWwyZKtzfF16czuEIPoJwUiQXX8jwDZLlyz2rECgYB3fCoBdsxM/Xq87PGuSobrnIgFN0lQtO+leA9bpAwRNwMOOGvuBLc/V1ZwWCuLv9yfTFgSAmk8an5a1GsPgD5rOOfIhZOh8c1I/92+wneGHFsWxGf9rM/CURn4qoDP4xNkw8Cu0z33UuLZSO9TRRvwCEi2xZnunePHF0PIgIRbqQ==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtg44sim03u5xektdxysuIBCL910ip9OIIKkZo8icmkKwRNz+JQwhB9JF+YDbw6aFDSzEE1QqNqyOIGO/ZTq9yfDzhagWLicE7U0ZOGjQx+s2XMaOXA1onpfFveakbD/9v1DtuCXdoMn5VfdIPrqXPLy+8SZMbC/tzv7jCDukFmBEfEUZwUOZf5c0cWxOtBqSrpnBoVJNEk0B6qIMV6Xc55ADFNAZv6hf3NB/EXFZBFiG89H/yevWhnvRjnHyeYqLbUpTIWkAVHgjWdybu2npygWtCVSZk8BdA73CILbO/j6JaR9qCEB4KJlrGPR4qgTiEIgWv2+iLcXUb0GxveLGUQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://47.106.73.53:80/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://47.106.73.53:80/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
